//
//  SongListCell.m
//  GSG
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "SongListCell.h"

@implementation SongListCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(void)dealloc{
    [_singerName release];
    [_songName release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.view = [[UIView alloc] init];
        [self.contentView addSubview:self.view];

        [_view release];
        
        
        _songName=[[UILabel alloc]init];
        [self.view addSubview:_songName];
        _songName.font=[UIFont systemFontOfSize:20];
        [_songName release];
        
        _singerName=[[UILabel alloc]init];
        [self.view addSubview:_singerName];
        [_singerName release];
        
//        self.button = [UIButton buttonWithType:UIButtonTypeCustom];
//        self.button.layer.borderWidth = 1;
//        [self.button setTitle:@"收藏" forState:UIControlStateNormal];
//        [self.view addSubview:self.button];
        
        
//        self.button1 = [UIButton buttonWithType:UIButtonTypeCustom];
//        self.button1.layer.borderWidth = 1;
//        [self.button1 addTarget:self action:@selector(collect) forControlEvents:UIControlEventTouchUpInside];
//        [self.button1 setTitle:@"分享" forState:UIControlStateNormal];
//        [self.view addSubview:self.button1];
//        self.button.frame = CGRectMake(5, 30, 40, 40);
//        self.button1.frame = CGRectMake(330, 30, 40, 40);
        
//         self.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bujing.png"]];
        
    }
    return self;
}
-(void) layoutSubviews{
    [super layoutSubviews];
    
    self.view.frame = CGRectMake(0, 0, self.contentView.frame.size.width, 100);
    _songName.frame=CGRectMake(20, self.view.frame.size.height * 10 / 667, self.contentView.frame.size.width-100, self.view.frame.size.height * 800 / 1667);
    _singerName.frame=CGRectMake(20, self.view.frame.size.height * 800 / 1334, self.contentView.frame.size.width - 100, self.view.frame.size.height * 500 / 1667);
    
    
}
-(void)collect{
    NSLog(@"123");
}

@end
